{
 "cells": [
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": [
    "# Hello World Agent\n",
    "\n",
    "Our first LangGraph graph."
   ],
   "id": "d829ebcaf2503ed3"
  },
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-06-25T02:11:17.784595Z",
     "start_time": "2025-06-25T02:11:16.439175Z"
    }
   },
   "source": [
    "from langgraph.graph import StateGraph\n",
    "from typing import TypedDict"
   ],
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-25T02:11:19.589156Z",
     "start_time": "2025-06-25T02:11:19.579563Z"
    }
   },
   "cell_type": "code",
   "source": [
    "class AgentState(TypedDict):\n",
    "    message: str\n",
    "\n",
    "def greeting_node(state: AgentState) -> AgentState:\n",
    "    \"\"\"Simple node that adds greeting message to the state.\"\"\"\n",
    "\n",
    "    state[\"message\"] = f\"Hey {state[\"message\"]}, how is your day going?\"\n",
    "\n",
    "    return state"
   ],
   "id": "cb5f16056c03bc64",
   "outputs": [],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-25T02:11:21.774009Z",
     "start_time": "2025-06-25T02:11:21.750565Z"
    }
   },
   "cell_type": "code",
   "source": [
    "graph = StateGraph(AgentState)\n",
    "\n",
    "graph.add_node(\"greeter\", greeting_node)\n",
    "\n",
    "graph.set_entry_point(\"greeter\")\n",
    "graph.set_finish_point(\"greeter\")\n",
    "\n",
    "app = graph.compile()\n"
   ],
   "id": "1e818afe6ea5af00",
   "outputs": [],
   "execution_count": 3
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-24T14:27:18.034479Z",
     "start_time": "2025-06-24T14:27:15.929779Z"
    }
   },
   "cell_type": "code",
   "source": [
    "from IPython.display import Image, display\n",
    "\n",
    "display(Image(app.get_graph().draw_mermaid_png(max_retries=5)))"
   ],
   "id": "3be602e10e2187fb",
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGoAAADqCAIAAADF80cYAAAAAXNSR0IArs4c6QAAFglJREFUeJztnWl8FEXegKun576PTMjFkJAQjoQgTEiQGA7Jcki4IsutHOuyAcRFPH4oiCusym+FRRZdDKuu6EbgXQGFgKC+L0oUkAAJV+RIICH3OfdMz0z39Pth2CzGOTpTM2QS6/mUTFdX/+eZ6u7qquoqjKZpgAgUVncH0LNB+qBA+qBA+qBA+qBA+qBgQ+7fWEVYjBRhoQgrRTl7Rh0I52B8Ic4X4WIZ3qcfHyYrLLB6352rlttXLZWXzRI5W6rk8EU4X8TicHtGWXY6XITFZbNQxjanxUAmDhP3TxXFp4gCyKrL+ppr7N/+u9lpdw1MlyY9JJarOQEcNXzQtzhvlZpunDfxBKxxv41Ux/G6tHsX9FFO+tTBlurr1szJysGZ0oCiDV+unTGeO97Wf6h47Gw1872Y6rOZqSO76/v04499vAu59ywoJ33qUEtrnT339zECMc5kF0b62hoch9+re2icYvh4eTDiDGsufKO7/L1hRn6MMorrN7F/fRYDuW9rTfasiOQRkuAFGdbcOG86XdQ6Z61GJPVTBv3cK0mH63BBfVq27NfjDgAwMF2S8rDsyO46ivRTtvzo+/F4u1zNGTlRGdTwegAZk5RiOfvciXbfyXzpM7Q6r5eYchZGBTu2nsHERVE/nTOadKSPNL70ff9568iJSg4XC0FsPQAunzVivKL48xYfabzqM7Q6WxvsQ7NkoYmtZ5CWLW+qtvsogF713So1D82SYT3jMSxUsHAwNEt2q9TkNYG3DRWXTP0GB/IYCMO4ceMaGxu7ute+ffs2bdoUmohAv8HCijKzt62e9Zn1pM1EqaL91xuDSG1trdnsNVAflJeXhyCce6jjeMZ20tv567nBqqGK6OrDM3Nomi4sLDx27Fh1dXViYuKoUaPy8/MvXLiwYsUKAEBubu64ceO2bt1aUVHx2WeflZSUNDY2JiYmPv744zNmzAAA3Lx5c8GCBTt27HjttdciIyMFAkFpaSkA4PDhw59++mlycnLQA46M4zXX2CU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Da9tBVoqOSCLtFIY9SKe+tJtfaXisVd16CshMKedTNih87xm9cv3k6pKXPaSOFEl+/qK9rH1/IYnNZTiIkBXBgUmZyUua/v3hDb2gyW3TFZ/a/vWvxhUtf+t4rLWWC0dRadGInAOBWZcnZ85+DkFVcHFaSw8e5fF+K/NT7NIOEpharsq802LEBAMBTT7x9puTgJ/vXV9dciVTHZ2pnPDzSzyqMQwZmPTZx1dmSQ9/9UKiQR8/L27jrwxUuV0hOEVOrNSHVzxOXn9bmykvmM8cNcWlRwY6tB1B7qXF0rry/T4N+qsRxyUJDs81hDdUNJGxx2Ehji61vsp8HVj8nL0/AGqiVNt7WxaV6fnSjKPLVLZM8biJJBxvneqyVxUYnr1i2y/ehu8Qrr+fQwPNp5HJRLJaHy78mLmX54r95y7C5on3gSCmH6+eq6r+ryGam9myuik+P4XtpqW/X1Xv8nCDM7hrvL8FxjkwazEdpbzEAABxOO5fjoeuHzeZKJZ5v9ITJUX2xYcmr8X4nr2fU01b6re7iSWPCyBgWHr4jCIKFi3TdKakf+RtZWrb/RmJGOh4aI1fHcGqvtoThSN7gQtN0zeWmiBjO0CxGnROM9GEs7LFl0RycarzBqAOl59JwvZ3Lpaf+LhpjMapLMj0Z2Rxs1soYQNrvljW5mHXi9SxcJH23rAlzOWatjGUzHjHUtUEaFEl/+VFj012HZngUh9971oxxEmT1xcaY/rxJT/TB2V14hglkhNX5r3Tn/08XoZEpNTIW3rMXIaMour1a33bXmP4bRXqOgsEePyPAAWq6Jmfpd/o7Vy1CuVAg54lVAjb3QSy/EyxIgjLrbFaD3aaz9h8qGj5OLlcH0jAMNbqUdNJV16w3yyw1P5lpgPHFHK6Qw+aF6UlN04BykA6rk7A4MBpohogHDBclpUH1IwbtrSKzntS3OA2tTiad890DBkRStiyCI1dzxPLg/Mbh+FJWD6L3P0WEFKQPCqQPCqQPCqQPCqQPiv8HLrFW0HdFjrEAAAAASUVORK5CYII=",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 4
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-25T02:11:24.841037Z",
     "start_time": "2025-06-25T02:11:24.814192Z"
    }
   },
   "cell_type": "code",
   "source": [
    "result = app.invoke({\"message\": \"Alice\"})\n",
    "\n",
    "result[\"message\"]"
   ],
   "id": "d8a71a6fd061285e",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hey Alice, how is your day going?'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 5
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
